package twentytwenty;

/**
 * @Author: Zahi
 * @Description:
 * @Date Created in 2020-12-11 11:33
 * @Modified By:
 */
public class IsPowerOfTwo_231 {
    public static void main(String[] args) {
        int n = 218;
        System.out.println(isPowerOfTwo(n));
    }

    public static boolean isPowerOfTwo(int n) {
        double change = (double) n;
        while (change >= 1){
            if (change == 1){
                return true;
            }
            change /= 2;
        }
        return false;
    }
}
